package com.lzq.Injector;

/**
 * 适配旧框架的 Mapper 方法
 *
 * @author pengrx
 */
public enum AdapterOldSqlMethod {

    QUERY_BY_ID("queryById", "根据 ID 查询一条数据", "SELECT %s FROM %s WHERE %s=#{%s}"),
    QUERY_BY_ENTITY("queryByEntity", "根据 entity 中条件 and 组合查询", "<script>\n\n</script>"),
    QUERY_BY_ENTITY_ORDER("queryByEntityOrder", "", "<script>\n\n</script>"),
    UPDATE("update", "根据ID 选择修改数据", "<script>\nUPDATE %s %s WHERE %s=#{%s} %s\n</script>"),
    DELETE("delete", "", "<script>\n\n</script>");

    private final String method;
    private final String desc;
    private final String sql;

    AdapterOldSqlMethod(String method, String desc, String sql) {
        this.method = method;
        this.desc = desc;
        this.sql = sql;
    }

    public String getMethod() {
        return method;
    }

    public String getDesc() {
        return desc;
    }

    public String getSql() {
        return sql;
    }

}
